home *** CD-ROM | disk | FTP | other *** search
/ Aminet 1 (Walnut Creek) / Aminet - June 1993 [Walnut Creek].iso / aminet / gfx / misc / blurm_11.lha / BlurMotion.oprx next >
Text File  |  1992-11-18  |  15KB  |  522 lines

  1. /*                The BLUR-MOTION Machine  v1.1                    */
  2. /*                                                                 */
  3. /*                      by Carmen Rizzolo                          */
  4. /*                                                                 */
  5. /*                          11/15/92                               */
  6. /*                                                                 */
  7. /*               For OpalPaint v1.1 and Imagine                    */
  8. /*                                                                 */
  9.  
  10. /* History:                                                        */
  11. /* v1.0   Initial release                                          */
  12. /* v1.0a  Released 5 minutes later.  Woops!                        */
  13. /* v1.0b  Another minor bug fixed.                                 */
  14. /*        Now will not ZAP if new Image did not load successfully. */
  15. /* v1.1   Changed selected frames in a 15 frame group to be more   */
  16. /*        evenly spread throughout the group.  Helps enhance       */
  17. /*        blurring in parts of animation with more subtle motion.  */
  18. /*        Changed 9-frame method to a 7-frame method.              */
  19.  
  20. /*  See documentation for more information                         */
  21.  
  22. /* User definable variables */
  23. IMPath = 'Imagine:'
  24.  
  25. /* Don't touch anything else! */
  26. ROOT = 'pic.'
  27. ZERO = '0'
  28. Options Results
  29. Address 'OpalPaint_Rexx'
  30.  
  31. /* Check = Addlib('Rexxsupport.library'0,-30,0)
  32. Okay 'Check ='  Check
  33. IF ~SHOW('L',"Rexxsupport.library") Then Do
  34.     If Addlib('Rexxsupport.library',0,-30,0) Then Do
  35.     Okay 'Loading Library.'
  36.     End
  37. Else Do
  38.     Okay 'no library available'
  39.     Exit
  40.     End
  41. IF SHOW('L:',"Rexxsupport.library") Then Do
  42.     Okay 'Library confirmed!'
  43.     End */
  44.  
  45. /* Confirm which script OP launched, and give the option to abort */
  46. AskBool 'The BLUR-MOTION MACHINE by Carmen Rizzolo - 11/15/92\nOK to continue, Cancel to abort.'
  47. If Result = 0 Then Exit
  48.  
  49. /* Get blurring frame-span number */
  50. AskInt 1 2 'Choose method Number: 1 = 5-frame   2 = 7-frame\n\nConsult documentation for more information.'
  51. If RC = 5 Then Do
  52.     Okay 'Exiting...'
  53.     Exit
  54.     End
  55. Method = Result
  56.  
  57. /* Get Imagine project name: */
  58. Do Forever
  59.     Askstring 'Enter the name of your Imagine project.\nDo not include pathname or ".imp" extension.\nExamples:\nPointless = Right  Imagine:Pointless = Wrong  Pointless.imp = Wrong.'
  60.     If RC = 5 Then Do
  61.         Okay 'Exiting...'
  62.         Exit
  63.         End
  64.     Project = Result
  65.     Finder = Exists(IMPath || Project || '.imp/')
  66.     If Finder = 1 Then Do
  67.         Leave
  68.         End
  69.     Okay 'Project dir not found!  Check your spelling.'
  70.     End
  71.  
  72. /* Get rendering subproject name*/
  73. /* LoRes = Right  A = Right  LoRes.pix = Wrong */
  74. /* Imagine:Pointless.imp/A.pix = Wrong */
  75. Do Forever
  76.     Address 'OpalPaint_Rexx'
  77.     AskString 'Enter rendering subproject name, without path and ".pix"\nExamples:\na = Right  LoRes = Right  Imagine:Pointless.imp/a.pix = wrong'
  78.     If RC = 5 Then Do
  79.         Okay 'Exiting...'
  80.         Exit
  81.         End
  82.     Sub = Result
  83.     Finder = Exists(IMPath || Project || '.imp/' || Sub || '.pix/')
  84.     If Finder = 1 Then Leave
  85.     Address 'OpalPaint_Rexx'
  86.     Okay 'Rendering subproject not found!  Check your spelling.'
  87.     End
  88.  
  89. /* Get starting frame number */
  90. /* 1 = Right  35 = Right  pic.0001 = Wrong  0001 = Wrong */
  91. Address 'OpalPaint_Rexx'
  92. AskInt 1 9998 'Enter Starting Frame Number as a normal number\nExamples:\n1 = Right  pic.0001 = Wrong  0001 = Wrong\nSee documentation for more information.'
  93. If RC = 5 Then Do
  94.     Okay 'Exiting...'
  95.     Exit
  96.     End
  97. StartFrame = Result
  98. If StartFrame > 1 Then Do
  99.     A = StartFrame
  100.     A = A - 1
  101.     A = A / 15
  102.     A = ABS(A)
  103.     If A = Trunc(A) Then Do
  104.         Nop
  105.         End
  106.     Else Do
  107.         Okay 'Sorry, Starting number is not acceptable.\nSee documentation for more information.\nExiting...'
  108.         Exit
  109.         End
  110.     End
  111.  
  112. /* Get Ending frame number */
  113. /* 1 = Right  35 = Right  pic.0001 = Wrong  0001 = Wrong */
  114. Address 'OpalPaint_Rexx'
  115. AskInt 1 9999 'Enter Ending Frame Number as a normal number\nExamples:\n1 = Right  pic.0001 = Wrong  0001 = Wrong\nSee documentation for more information.'
  116. If RC = 5 Then Do
  117.     Okay 'Exiting...'
  118.     Exit
  119.     End
  120. EndFrame = Result
  121.     A = EndFrame
  122.     A = A - 1
  123.     A = A / 15
  124.     A = ABS(A)
  125. If A = Trunc(A) Then Do
  126.     Nop
  127.     End
  128. Else Do
  129.     Okay 'Sorry, Ending number is not acceptable.  See docs.  Exiting...'
  130.     Exit
  131.     End
  132.  
  133. /* Get name for destination drawer.  This drawer will be created */
  134. /* inside the project's drawer, the same place Imagine makes it's */
  135. /* subproject drawers */
  136. Done = 0
  137. Do Forever
  138.     Address "OpalPaint_Rexx"
  139.     AskString 'Enter a drawer name for destination files'
  140.     If RC = 5 Then Do
  141.         Okay 'Exiting...'
  142.         Exit
  143.         End
  144.     DestDir = Result
  145.     Finder = Exists(IMPath || Project || '.imp/' || DestDir || '/')
  146.     If Finder = 1 Then Do
  147.         Address "OpalPaint_Rexx"
  148.         AskBool DestDir || ' already exsists.  Use it?'
  149.         If Result = 1 Then Done = 1
  150.         End
  151.     If Finder = 0 Then Do
  152.         Address Command
  153.         MakeDir IMPath || Project || '.imp/' || DestDir
  154.         Done = 1
  155.         End
  156.     If Done = 1 Then Leave
  157.     End
  158.  
  159. /* Delete? */
  160. Address 'OpalPaint_Rexx'
  161. AskBool 'Delete frames as I go (Cancel = No)?'
  162. Deleter = Result
  163.  
  164. /* Here we go! */
  165. Okay 'Operation beginning.\nI will wait if an image is rendering.'
  166.  
  167. /*StartFrame = StartFrame - 1
  168. EndFrame = EndFrame - 1*/
  169.  
  170. Do A = StartFrame To EndFrame By 15
  171. Address 'OpalPaint_Rexx'
  172.  
  173. /* Get IFF Variables */
  174. If Method = 1 Then Do
  175.  
  176.     Iffa = Root || Zero || Zero || Zero || ( A + 1 )
  177.     If ( A + 1 ) < 10000 & ( A + 1 ) > 999 Then Iffa = Root || ( A + 1 )
  178.     If ( A + 1 ) < 1000 & ( A + 1 ) > 99 Then Iffa = Root || Zero || ( A + 1 )
  179.     If ( A + 1 ) < 100 & ( A + 1 ) > 9  Then Iffa = Root || Zero || Zero || ( A + 1 )
  180.  
  181.     Iffb = Root || Zero || Zero || Zero || ( A + 4 )
  182.     If ( A + 4 ) < 10000 & ( A + 4 ) > 999 Then Iffb = Root || ( A + 4 )
  183.     If ( A + 4 ) < 1000 & ( A + 4 ) > 99 Then Iffb = Root || Zero || ( A + 4 )
  184.     If ( A + 4 ) < 100 & ( A + 4 ) > 9  Then Iffb = Root || Zero || Zero || ( A + 4 )
  185.  
  186.     Iffc = Root || Zero || Zero || Zero || ( A + 7 )
  187.     If ( A + 7 ) < 10000 & ( A + 7 ) > 999 Then Iffc = Root || ( A + 7 )
  188.     If ( A + 7 ) < 1000 & ( A + 7 ) > 99 Then Iffc = Root || Zero || ( A + 7 )
  189.     If ( A + 7 ) < 100 & ( A + 7 ) > 9  Then Iffc = Root || Zero || Zero || ( A + 7 )
  190.  
  191.     Iffd = Root || Zero || Zero || Zero || ( A + 10 )
  192.     If ( A + 10 ) < 10000 & ( A + 10 ) > 999 Then Iffd = Root || ( A + 10 )
  193.     If ( A + 10 ) < 1000 & ( A + 10 ) > 99 Then Iffd = Root || Zero || ( A + 10 )
  194.     If ( A + 10 ) < 100 & ( A + 10 ) > 9  Then Iffd = Root || Zero || Zero || ( A + 10 )
  195.  
  196.     Iffe = Root || Zero || Zero || Zero || ( A + 13 )
  197.     If ( A + 13 ) < 10000 & ( A + 13 ) > 999 Then Iffe = Root || ( A + 13 )
  198.     If ( A + 13 ) < 1000 & ( A + 13 ) > 99 Then Iffe = Root || Zero || ( A + 13 )
  199.     If ( A + 13 ) < 100 & ( A + 13 ) > 9  Then Iffe = Root || Zero || Zero || ( A + 13 )
  200.  
  201.     End
  202.  
  203. If Method = 2 Then Do
  204.  
  205.     Iffa = Root || Zero || Zero || Zero || ( A + 1 )
  206.     If ( A + 1 ) < 10000 & ( A + 1 ) > 999 Then Iffa = Root || ( A + 1 )
  207.     If ( A + 1 ) < 1000 & ( A + 1 ) > 99 Then Iffa = Root || Zero || ( A + 1 )
  208.     If ( A + 1 ) < 100 & ( A + 1 ) > 9  Then Iffa = Root || Zero || Zero || ( A + 1 )
  209.  
  210.     Iffb = Root || Zero || Zero || Zero || ( A + 3 )
  211.     If ( A + 3 ) < 10000 & ( A + 3 ) > 999 Then Iffb = Root || ( A + 3 )
  212.     If ( A + 3 ) < 1000 & ( A + 3 ) > 99 Then Iffb = Root || Zero || ( A + 3 )
  213.     If ( A + 3 ) < 100 & ( A + 3 ) > 9  Then Iffb = Root || Zero || Zero || ( A + 3 )
  214.  
  215.     Iffc = Root || Zero || Zero || Zero || ( A + 5 )
  216.     If ( A + 5 ) < 10000 & ( A + 5 ) > 999 Then Iffc = Root || ( A + 5 )
  217.     If ( A + 5 ) < 1000 & ( A + 5 ) > 99 Then Iffc = Root || Zero || ( A + 5 )
  218.     If ( A + 5 ) < 100 & ( A + 5 ) > 9  Then Iffc = Root || Zero || Zero || ( A + 5 )
  219.  
  220.     Iffd = Root || Zero || Zero || Zero || ( A + 7 )
  221.     If ( A + 7 ) < 10000 & ( A + 7 ) > 999 Then Iffd = Root || ( A + 7 )
  222.     If ( A + 7 ) < 1000 & ( A + 7 ) > 99 Then Iffd = Root || Zero || ( A + 7 )
  223.     If ( A + 7 ) < 100 & ( A + 7 ) > 9  Then Iffd = Root || Zero || Zero || ( A + 7 )
  224.  
  225.     Iffe = Root || Zero || Zero || Zero || ( A + 9 )
  226.     If ( A + 9 ) < 10000 & ( A + 9 ) > 999 Then Iffe = Root || ( A + 9 )
  227.     If ( A + 9 ) < 1000 & ( A + 9 ) > 99 Then Iffe = Root || Zero || ( A + 9 )
  228.     If ( A + 9 ) < 100 & ( A + 9 ) > 9  Then Iffe = Root || Zero || Zero || ( A + 9 )
  229.  
  230.     Ifff = Root || Zero || Zero || Zero || ( A + 11 )
  231.     If ( A + 11 ) < 10000 & ( A + 11 ) > 999 Then Ifff = Root || ( A + 11 )
  232.     If ( A + 11 ) < 1000 & ( A + 11 ) > 99 Then Ifff = Root || Zero || ( A + 11 )
  233.     If ( A + 11 ) < 100 & ( A + 11 ) > 9  Then Ifff = Root || Zero || Zero || ( A + 11 )
  234.  
  235.     Iffg = Root || Zero || Zero || Zero || ( A + 13 )
  236.     If ( A + 13 ) < 10000 & ( A + 13 ) > 999 Then Iffg = Root || ( A + 13 )
  237.     If ( A + 13 ) < 1000 & ( A + 13 ) > 99 Then Iffg = Root || Zero || ( A + 13 )
  238.     If ( A + 13 ) < 100 & ( A + 13 ) > 9  Then Iffg = Root || Zero || Zero || ( A + 13 )
  239.  
  240.     End
  241.  
  242. Address 'OpalPaint_Rexx'
  243. SaveSetUp
  244.  
  245. /*                         -- Method 1 --                          */
  246. If Method = 1 Then Do
  247. /* Wait for Imagine to finish rendering */
  248.     Do Forever
  249.         If Open('Render',IMPath || Project || '.imp/' || Sub || '.pix/' || Iffe,'Read') Then Do
  250.             B = Close('Render')
  251.             Leave
  252.             End
  253.         /* Wait a minute to cut down on CPU useage */
  254.         Address Command
  255.         Wait Min
  256.         End
  257.  
  258.         Address 'OpalPaint_Rexx'
  259.         /* Initialize OpalPaint */
  260.         Busy
  261.         Loader IFF
  262.         FillMode SOLID
  263.         SetDrawMode 1
  264.         SmoothPaper
  265.         ClearColGrad
  266.         ClearTransGrad
  267.         ColourDither 0
  268.         TransDither 0
  269.         ActiveNozzle 1
  270.  
  271.         DeletePage 2
  272.         DeletePage 3
  273.         DeletePage 4
  274.         DeletePage 5
  275.         DeletePage 6
  276.         DeletePage 7
  277.         DeletePage 8
  278.         DeletePage 9
  279.  
  280.         MyRC = 1
  281.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffa
  282.         If RC = 10 Then MyRC = 0
  283.         ClonePage
  284.         SwapPage 1 2
  285.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffe
  286.         If RC = 10 Then MyRC = 0
  287.         SwapPage 1 2
  288.         SecondaryPage 2
  289.         CurrPage 1
  290.         RubDirection 0
  291.         Trans 1
  292.         TransType Standard 78
  293.         RubMode ABSOLUTE
  294.         TextureType RUBTHROUGH
  295.         Texture 1
  296.         If MyRC = 1 Then Zap
  297.  
  298.         SwapPage 1 2
  299.         MyRC = 1
  300.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffb
  301.         If RC = 10 Then MyRC = 0
  302.         SwapPage 1 2
  303.         SecondaryPage 2
  304.         CurrPage 1
  305.         RubDirection 0
  306.         Trans 1
  307.         TransType Standard 78
  308.         RubMode ABSOLUTE
  309.         TextureType RUBTHROUGH
  310.         Texture 1
  311.         If MyRC = 1 Then Zap
  312.  
  313.         SwapPage 1 2
  314.         MyRC = 1
  315.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffd
  316.         If RC = 10 Then MyRC = 0
  317.         SwapPage 1 2
  318.         SecondaryPage 2
  319.         CurrPage 1
  320.         RubDirection 0
  321.         Trans 1
  322.         TransType Standard 78
  323.         RubMode ABSOLUTE
  324.         TextureType RUBTHROUGH
  325.         Texture 1
  326.         If MyRC = 1 Then Zap
  327.  
  328.         SwapPage 1 2
  329.         MyRC = 1
  330.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffc
  331.         If RC = 10 Then MyRC = 0
  332.         SwapPage 1 2
  333.         SecondaryPage 2
  334.         CurrPage 1
  335.         RubDirection 0
  336.         Trans 1
  337.         TransType Standard 78
  338.         RubMode ABSOLUTE
  339.         TextureType RUBTHROUGH
  340.         Texture 1
  341.         If MyRC = 1 Then Zap
  342.  
  343.         If A > 1 Then Do
  344.             B = A / 15
  345.             B = ( B + 1 )
  346.             B = Trunc(B)
  347.             End
  348.         Else Do
  349.             B = A
  350.             End
  351.         SaveIff = Root || Zero || Zero || Zero || B
  352.         If B < 10000 & B > 999 Then SaveIff = Root || B
  353.         If B < 1000 & B > 99 Then SaveIff = Root || Zero || B
  354.         If B < 100 & B > 9  Then SaveIff = Root || Zero || Zero || B
  355.         Save IMPath || Project || '.imp/' || DestDir || '/' || SaveIff
  356.  
  357.         End
  358.  
  359. /*                         -- Method 2 --                          */
  360. If Method = 2 Then Do
  361. /* Wait for Imagine to finish rendering */
  362.     Do Forever
  363.         If Open('Render',IMPath || Project || '.imp/' || Sub || '.pix/' || Iffg,'Read') Then Do
  364.             B = Close('Render')
  365.             Leave
  366.             End
  367.         /* Wait a minute to cut down on CPU useage */
  368.         Address Command
  369.         Wait Min
  370.         End
  371.  
  372.         Address 'OpalPaint_Rexx'
  373.         /* Initialize OpalPaint */
  374.         Busy
  375.         Loader IFF
  376.         FillMode SOLID
  377.         SetDrawMode 1
  378.         SmoothPaper
  379.         ClearColGrad
  380.         ClearTransGrad
  381.         ColourDither 0
  382.         TransDither 0
  383.         ActiveNozzle 1
  384.  
  385.         DeletePage 2
  386.         DeletePage 3
  387.         DeletePage 4
  388.         DeletePage 5
  389.         DeletePage 6
  390.         DeletePage 7
  391.         DeletePage 8
  392.         DeletePage 9
  393.  
  394.         MyRC = 1
  395.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffa
  396.         If RC = 10 Then MyRC = 0
  397.         ClonePage
  398.         SwapPage 1 2
  399.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffg
  400.         If RC = 10 Then MyRC = 0
  401.         SwapPage 1 2
  402.         SecondaryPage 2
  403.         CurrPage 1
  404.         RubDirection 0
  405.         Trans 1
  406.         TransType Standard 88
  407.         RubMode ABSOLUTE
  408.         TextureType RUBTHROUGH
  409.         Texture 1
  410.         If MyRC = 1 Then Zap
  411.  
  412.         SwapPage 1 2
  413.         MyRC = 1
  414.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffb
  415.         If RC = 10 Then MyRC = 0
  416.         SwapPage 1 2
  417.         SecondaryPage 2
  418.         CurrPage 1
  419.         RubDirection 0
  420.         Trans 1
  421.         TransType Standard 88
  422.         RubMode ABSOLUTE
  423.         TextureType RUBTHROUGH
  424.         Texture 1
  425.         If MyRC = 1 Then Zap
  426.  
  427.         SwapPage 1 2
  428.         MyRC = 1
  429.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Ifff
  430.         If RC = 10 Then MyRC = 0
  431.         SwapPage 1 2
  432.         SecondaryPage 2
  433.         CurrPage 1
  434.         RubDirection 0
  435.         Trans 1
  436.         TransType Standard 88
  437.         RubMode ABSOLUTE
  438.         TextureType RUBTHROUGH
  439.         Texture 1
  440.         If MyRC = 1 Then Zap
  441.  
  442.         SwapPage 1 2
  443.         MyRC = 1
  444.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffc
  445.         If RC = 10 Then MyRC = 0
  446.         SwapPage 1 2
  447.         SecondaryPage 2
  448.         CurrPage 1
  449.         RubDirection 0
  450.         Trans 1
  451.         TransType Standard 88
  452.         RubMode ABSOLUTE
  453.         TextureType RUBTHROUGH
  454.         Texture 1
  455.         If MyRC = 1 Then Zap
  456.  
  457.         SwapPage 1 2
  458.         MyRC = 1
  459.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffe
  460.         If RC = 10 Then MyRC = 0
  461.         SwapPage 1 2
  462.         SecondaryPage 2
  463.         CurrPage 1
  464.         RubDirection 0
  465.         Trans 1
  466.         TransType Standard 88
  467.         RubMode ABSOLUTE
  468.         TextureType RUBTHROUGH
  469.         Texture 1
  470.         If MyRC = 1 Then Zap
  471.  
  472.         SwapPage 1 2
  473.         MyRC = 1
  474.         Load || ' ' || IMPath || Project || '.imp/' || Sub || '.pix/' || Iffd
  475.         If RC = 10 Then MyRC = 0
  476.         SwapPage 1 2
  477.         SecondaryPage 2
  478.         CurrPage 1
  479.         RubDirection 0
  480.         Trans 1
  481.         TransType Standard 88
  482.         RubMode ABSOLUTE
  483.         TextureType RUBTHROUGH
  484.         Texture 1
  485.         If MyRC = 1 Then Zap
  486.  
  487.         If A > 1 Then Do
  488.             B = A / 15
  489.             B = Trunc(B)
  490.             B = ( B + 1 )
  491.             End
  492.         Else Do
  493.             B = A
  494.             B = Trunc(B)
  495.             End
  496.         SaveIff = Root || Zero || Zero || Zero || B
  497.         If B < 10000 & B > 999 Then SaveIff = Root || B
  498.         If B < 1000 & B > 99 Then SaveIff = Root || Zero || B
  499.         If B < 100 & B > 9  Then SaveIff = Root || Zero || Zero || B
  500.         Save IMPath || Project || '.imp/' || DestDir || '/' || SaveIff
  501.  
  502.         End
  503.  
  504. If Deleter = 1 Then Do
  505.     Address Command
  506.     Delete IMPath || Project || '.imp/' || Sub || '.pix/' || Iffa
  507.     Delete IMPath || Project || '.imp/' || Sub || '.pix/' || Iffb
  508.     Delete IMPath || Project || '.imp/' || Sub || '.pix/' || Iffc
  509.     Delete IMPath || Project || '.imp/' || Sub || '.pix/' || Iffd
  510.     Delete IMPath || Project || '.imp/' || Sub || '.pix/' || Iffe
  511.     If Method = 2 Then Do
  512.         Delete IMPath || Project || '.imp/' || Sub || '.pix/' || Ifff
  513.         Delete IMPath || Project || '.imp/' || Sub || '.pix/' || Iffg
  514.         End
  515.     End
  516. End
  517. Address 'OpalPaint_Rexx'
  518. RestoreSetUp
  519. NotBusy
  520. Okay 'Operation Complete!'
  521. Exit
  522.